 /*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package framework.controller;

import framework.model.Factory;
import framework.model.FinancialCompany;
import framework.view.AddPersonalAccountDialog;
import java.awt.event.ActionEvent;
import java.util.HashMap;

/**
 *
 * @author ThanhNguyen
 */
public class AddPersonalAccountController implements IController {

    @Override
    public void actionPerformed(ActionEvent e) {
        AddPersonalAccountDialog d = Factory.getInstance().createAddPersonalAccountDialog();
        d.setVisible(true);
        if (d.isOK()) {
            HashMap<String, String> fields = d.getFields();
            FinancialCompany financialCompany = Factory.getInstance().getFinancialCompany();
            financialCompany.createAccount(fields);
            financialCompany.updateUI();
        }
    }
}
